xm-test: Identifying the network env specified in xend config fails,
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 6 Mar 2009 18:56:28 +0000 (18:56 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 6 Mar 2009 18:56:28 +0000 (18:56 +0000)
if an additional parameter is given for the network-bridge
(e.g. netdev=eth1) The patch splits the network command into the
command name and its parameters to determine the netenv (bridge,
route, nat)

Signed-off-by: juergen.gross@fujitsu-siemens.com
tools/xm-test/lib/XmTestLib/NetConfig.py

index 0c399698066ef33b0291ae215ed83b6c707e3dc1..857a9a5cca7a6f4c64cda18da7dc74e4705f8bba 100644 (file)
@@ -57,11 +57,13 @@ def getXendNetConfig():
     while val[0] != 'network-script':
         val = pin.get_val()
 
-    if val[1] == "network-bridge":
+    # split network command into script name and its parameters
+    sub_val = val[1].split()
+    if sub_val[0] == "network-bridge":
         netenv = "bridge"
-    elif val[1] == "network-route":
+    elif sub_val[0] == "network-route":
         netenv = "route"
-    elif val[1] == "network-nat":
+    elif sub_val[0] == "network-nat":
         netenv = "nat"
     else:
         raise NetworkError("Failed to get network env from xend config")